package com.ocom.payconfig.controller;

import com.ocom.common.constant.PayConfigUrl;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.payconfig.schoolphone.SchoolPhoneInfoVo;
import com.ocom.payconfig.service.SchoolPhoneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SchoolPhoneController {

    @Autowired
    private SchoolPhoneService schoolPhoneService;

    @PostMapping(PayConfigUrl.Url_getSchoolPhoneList)
    public Result getSchoolPhoneList(@RequestBody SchoolPhoneInfoVo schoolPhoneInfoVo) {

        Long comId = Long.valueOf(schoolPhoneInfoVo.getComId());
        return schoolPhoneService.getSchoolPhone(comId, schoolPhoneInfoVo);
    }

    @PostMapping(PayConfigUrl.Url_updateSchoolPhoneInfo)
        public Result updateSchoolPhoneInfo(@RequestBody SchoolPhoneInfoVo schoolPhoneInfoVo) {
        Long comId = Long.valueOf(schoolPhoneInfoVo.getComId());
        return schoolPhoneService.modifySchoolPhone(comId, schoolPhoneInfoVo);
    }

}
